﻿
@{
    Layout = null;
}
<!DOCTYPE HTML>
<html>
<head>
    <meta charset="utf-8">
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
    <meta http-equiv="Cache-Control" content="no-siteapp" />
    <!--[if lt IE 9]>
    <script type="text/javascript" src="/admin/js/html5.js"></script>
    <script type="text/javascript" src="/admin/js/respond.min.js"></script>
    <script type="text/javascript" src="/admin/js/PIE_IE678.js"></script>
    <![endif]-->
    <link type="text/css" rel="stylesheet" href="/admin/css/H-ui.css" />
    <link type="text/css" rel="stylesheet" href="/admin/css/H-ui.admin.css" />
    <link type="text/css" rel="stylesheet" href="/admin/font/font-awesome.min.css" />
    <!--[if IE 7]>
    <link href="font/font-awesome-ie7.min.css" rel="stylesheet" type="text/css" />
    <![endif]-->
    <title>添加Banner</title>
</head>
<body>
    <div class="pd-20">
        <div class="Huiform">
            <form method="post" id="addForm" enctype="multipart/form-data">
                <table class="table table-bg">
                    <tbody>
                        <tr>
                            <th class="text-r">Banner图片：</th>
                            <td><input type="file" style="width:300px" class="" name="img" multiple datatype="*2-120" nullmsg="Banner图片不能为空"></td>
                        </tr>
                        <tr>
                            <th class="text-r">跳转地址：</th>
                            <td><input type="text" style="width:300px" class="input-text" value="" placeholder="" id="url" name="url"></td>
                        </tr>
                        <tr>
                            <th class="text-r">备注：</th>
                            <td><input type="text" style="width:300px" class="input-text" value="" placeholder="" id="remark" name="remark"></td>
                        </tr>
                        <tr>
                            <th></th>
                            <td><button class="btn btn-success radius" type="button" onclick="addBanner()"><i class="icon-ok"></i> 确定</button></td>
                        </tr>
                    </tbody>
                </table>
            </form>
        </div>
    </div>
    <script type="text/javascript" src="/admin/js/jquery.min.js"></script>
    <script type="text/javascript" src="/admin/js/Validform_v5.3.2_min.js"></script>
    <script type="text/javascript" src="/admin/js/H-ui.js"></script>
    <script type="text/javascript" src="/admin/js/H-ui.admin.js"></script>
    <script type="text/javascript">
        $(".Huiform").Validform();
        function addBanner() {
            var formData = new FormData(document.getElementById("addForm"));
            $.ajax({
                type: 'post',
                async: false,
                cache: false,
                contentType: false,
                processData: false,
                url: '/Admin/Banner/AddBanner',
                data: formData,
                success: function (data) {
                    if (data.code == 200) {
                        parent.reload();
                    } else {
                        alert(data.result);
                    }
                }
            });
        }
    </script>

</body>
</html>